home *** CD-ROM | disk | FTP | other *** search
- #include "migstub.h"
-
- //-----------------------------------------------------------------------------
- // The following code was written by Blueprint Software Works, DO NOT CHANGE IT!!!
- //
- // Initialization And UI Code...
- //-----------------------------------------------------------------------------
-
- pMigAcct MigLibAllocAcct(void){
- pMigAcct acct;
-
- acct=(pMigAcct)malloc(sizeof(MigAcct));
-
- acct->acctname=strdup("");
- acct->fromemail=strdup("");
- acct->fromreal=strdup("");
- acct->replyemail=strdup("");
- acct->replyreal=strdup("");
-
- acct->recvsmtp=0;
- acct->poprecvserv=strdup("");
- acct->poprecvport=110;
- acct->poprecvid=strdup("");
- acct->poprecvpass=strdup("");
- acct->ignore=0;
- acct->leave=0;
- acct->size=30;
- acct->useservview=0;
- acct->smtppath=strdup("");
- acct->poll=0;
- acct->interval=130;
-
- acct->sendpop=0;
- acct->smtpsendserv=strdup("");
- acct->smtpsendport=25;
- acct->popsendserv=strdup("");
- acct->popsendport=110;
- acct->popsendid=strdup("");
- acct->popsendpass=strdup("");
- acct->saveout=1;
- acct->wraptype=2;
- acct->wraplen=72;
- acct->defatttype=1;
- acct->safterf=0;
- acct->html=1;
-
- acct->viewfull=0;
- acct->noquote=0;
- acct->quotepre=strdup(">");
- acct->sysbeep=1;
- acct->wav=0;
- acct->wavfile=strdup("pmmail.wav");
- acct->passprot=0;
- acct->acctpass=strdup("");
- acct->startopen=1;
- acct->startsend=0;
- acct->startfetch=0;
- acct->emptytrash=0;
- acct->truedel=0;
-
- acct->spellalways=0;
- acct->skipcaps=0;
- acct->skipquote=0;
- acct->skipnum=0;
-
- acct->askcloprog=1;
- acct->askclocomp=1;
- acct->askrepatt=1;
- acct->promdelmes=1;
- acct->promdelfold=1;
- acct->promdelacct=1;
-
- acct->useext=0;
- acct->editor=strdup("notepad.exe");
- acct->args=strdup("%s");
- acct->type=0;
- acct->editcomp=1;
- acct->editread=0;
-
- acct->hookrecv=strdup("");
- acct->hooksend=strdup("");
- acct->sendexit=0;
- acct->recvexit=0;
- acct->sendbg=1;
- acct->recvbg=1;
- acct->hookcustf=strdup("");
- acct->hookcusts=strdup("");
- acct->custf=0;
- acct->custs=0;
- acct->custfbg=1;
- acct->custsbg=1;
-
- acct->begdial=0;
- acct->enddial=0;
- acct->begdialbg=1;
- acct->enddialbg=1;
- acct->hookbegd=strdup("");
- acct->hookendd=strdup("");
-
- acct->usephrase=1;
- acct->remphrase=1;
- acct->passphrase=strdup("");
- acct->signall=0;
- acct->inclpub=0;
- acct->inclprint=0;
- acct->secwarn=1;
-
- return(acct);
- }
-
- pMigAddr MigLibAllocAddr(void){
- pMigAddr addr;
-
- addr=(pMigAddr)malloc(sizeof(MigAddr));
-
- addr->group=0;
-
- addr->EMail=strdup("");
- addr->Alias=strdup("");
- addr->Name=strdup("");
-
- addr->Company=strdup("");
- addr->Title=strdup("");
- addr->HStreet=strdup("");
- addr->HCity=strdup("");
- addr->HState=strdup("");
- addr->HBuild=strdup("");
- addr->HPC=strdup("");
- addr->HCountry=strdup("");
- addr->HPhone=strdup("");
- addr->HExt=strdup("");
- addr->HFAX=strdup("");
- addr->BStreet=strdup("");
- addr->BCity=strdup("");
- addr->BState=strdup("");
- addr->BBuild=strdup("");
- addr->BPC=strdup("");
- addr->BCountry=strdup("");
- addr->BPhone=strdup("");
- addr->BExt=strdup("");
- addr->BFAX=strdup("");
-
- addr->Notes=strdup("");
- addr->File=strdup("");
- addr->inpopup=1;
-
- return(addr);
- }
-
- //-----------------------------------------------------------------------------
- // The following code should be modified as required to perform migration
- //
- // Migration Code...
- //-----------------------------------------------------------------------------
-
- //-----------------------------------------------------------------------------
- // MigLibGetName
- //
- // This function returns the generic name of the product that this library
- // migrates. You *must* return a strdup()'ed string so that the memory is
- // global to the process.
- //
- // This string is used in the detection process to inform the user which
- // library is active.
- //
- //-----------------------------------------------------------------------------
-
- char *MigLibGetName(void){
- //TODO: change the product name below
- char productname[]="Migration Stub Driver";
-
- return(strdup(productname));
- }
-
- //-----------------------------------------------------------------------------
- // MigLibGetInfo
- //
- // This function takes two double pointers. They are pointers to the first
- // and last members of a linked list of Migration Information structures.
- // These structures should be allocated and filled in. A description of each
- // member can be found in the migobj.h file.
- //
- // If your library can migrate more than one mailer, typically this function
- // will malloc more than one MigInfo structure. If, however, the library
- // only migrates one mailer, only one MigInfo structure would be allocated
- // and ppmifirst and ppmilast would both point to that single struct.
- //
- // This function returns an int indicating success. Return 1==success,
- // 0==failure.
- //
- //-----------------------------------------------------------------------------
-
- int MigLibGetInfo(pMigInfo *ppmifirst, pMigInfo *ppmilast){
- pMigInfo cur=0L, prev=0L;
- char temp[512];
- int i;
-
- for(i=0;i<4;i++){
- cur=(pMigInfo)malloc(sizeof(MigInfo));
-
- cur->libname=strdup("PMMSTUB.MIG");
-
- cur->available=TRUE;
- cur->mig=TRUE;
- sprintf(temp, "Stub v%d.0", i+1);
- cur->product=strdup(temp);
- sprintf(temp, "C:\\Program Files\\Stub%d", i+1);
- cur->path=strdup(temp);
- cur->infofound=MIG_ACCT|MIG_FOLD|MIG_MSGS|MIG_ADDR;
- cur->infomig=MIG_ACCT|MIG_FOLD|MIG_MSGS;
- cur->userdata=0L;
-
- cur->author=strdup("Blueprint Software Works, Inc.");
- cur->copyright=strdup("Copyright 2000, Blueprint Software Works, Inc.");
- cur->comment=strdup("Migration Stub Driver");
-
- cur->next=0L;
-
- if(prev) prev->next=cur;
- else *ppmifirst=cur;
- prev=cur;
- }
-
- *ppmilast=cur;
-
- return(1);
- }
-
- //-----------------------------------------------------------------------------
- // MigLibMigrateAcct
- //
- // This function takes two arguments:
- //
- // pMigInfo pmi: The MigInfo structure that is currently being
- // migrated. The data fields in this structure can
- // be used for reference purposes.
- //
- // The second is a pointer to a function that is used for creating accounts.
- // The prototype for this function is:
- //
- // void *MigrateCreateAcct(pMigAcct data);
- //
- // In this function, one would allocate a MigAcct structure by calling
- // MigLibAllocAcct. You *must* call MigLibAllocAcct to insure proper
- // default values are put in place. You then set any fields within the
- // MigAcct structure that are pertinant and available from the mailer
- // You are migrating. Then, call MigrateCreateAcct and store the return
- // value from this function. Descriptions of the members of MigAcct can
- // be found in migobj.h
- //
- // This function returns a void pointer. The return value should be the
- // return value from calling MigrateCreateAcct(data);
- //
- //-----------------------------------------------------------------------------
-
- void *MigLibMigrateAcct(pMigInfo pmi, PFNCREATEACCT MigrateCreateAcct){
- pMigAcct acct=0L;
- void *retval;
-
- acct=MigLibAllocAcct();
-
- acct->acctname=strdup(pmi->product);
- acct->fromreal=strdup("Stub Test User");
- acct->fromemail=strdup("test@test.com");
- acct->replyreal=strdup("Stub Test User");
- acct->replyemail=strdup("test@test.com");
-
- retval=MigrateCreateAcct(acct);
-
- return(retval);
- }
-
- //-----------------------------------------------------------------------------
- // MigLibMigrateFoldsAndMsgs
- //
- // This function takes many arguments:
- //
- // pMigInfo pmi: The MigInfo structure that is currently being
- // migrated. The data fields in this structure can
- // be used for reference purposes.
- //
- // void *acct: This is the account that the folders and messages
- // are being migrated into. Several of the functions
- // you will need to call will need this pointer.
- //
- // BOOL fold: This tells you whether or not the user has chosen to
- // migrate folders.
- //
- // BOOL msg: This tells you whether or not the user has chosen to
- // migrate messages.
- //
- // The next four arguments are function to control folders and messages.
- // Their prototypes are:
- //
- // int MigrateCreateFold(void *acct, int parentid, char *name, int sortord,
- // int sorttype[10], int indunread, int indany);
- //
- // acct: acct in which to create folder
- // id: id of folder's parent (-1==create at root;any other
- // value denotes the id of a parent folder)
- // sortord: the sort order of the address book
- // (0==ascending;1==descending)
- // sorttype: an array defining the sort priority for this folder.
- // The first position in the array defines which criterion
- // is sorted on first. If that matches, the second is
- // used, and so on.
- //
- // 0==Read Status
- // 1==Attachments
- // 2==Date & Time Of Message
- // 3==Date & Time Received
- // 4==Subject
- // 5==From E-Mail Address
- // 6==From Real Name
- // 7==To E-Mail Address
- // 8==To Real Name
- // 9==Size
- //
- // indunread: 0==The folder should *not* indicate unread messages
- // 1==The folder should indicate unread messages
- //
- // indany: 0==The folder should *not* indicate the presence of messages
- // 1==The folder should indicate the presence of messages
- //
- // char *MigrateGetFoldPath(void *acct, int id);
- //
- // acct: acct containing folder
- // id: id of folder
- //
- // int MigrateAddMessageToFold(void *acct, int msgstat, char *filename);
- //
- // acct: acct containing folder
- // msgstat: status to assign to the new message
- //
- // 0==read
- // 1==new
- // 2==replied or forwarded
- // 3==sent or waiting to be sent
- //
- // filename: the name of the file to be indexed
- //
- // int MigrateSaveFold(void *acct, int id);
- //
- // acct: acct containing folder
- // id: id of folder
- //
- // For all the functions which take a folder id, you may use FOLD_INBOX,
- // FOLD_OUTBOX, FOLD_SENT, and FOLD_TRASH to place messages or folders
- // within the inbox, outbox, sent mail, and trash folders, respectively.
- //
- // In this function, you would create folders as the user desires in the
- // acct that is passed in. To do this, one would call MigrateCreateFold.
- // Then, you must copy the messages to be inserted, one by one into the
- // folder. To get the hard drive path for a folder, call MigrateGetFoldPath.
- // After each file has been copied, you must call MigrateAddMsgToFold. Then,
- // after each folder is migrated, call MigrateSaveFold to write the message
- // index to the disk.
- //
- // This function does not return a value.
- //
- //-----------------------------------------------------------------------------
-
- void MigLibMigrateFoldsAndMsgs(pMigInfo pmi, void *acct, BOOL fold, BOOL msg, PFNCREATEFOLD MigrateCreateFold, PFNGETFOLDPATH MigrateGetFoldPath, PFNADDTOFOLD MigrateAddMessageToFold, PFNSAVEFOLD MigrateSaveFold){
- int ord[10], i, id;
-
- for(i=0;i<10;i++) ord[i]=i;
- id=MigrateCreateFold(acct, -1, "Stub Messages", 1, ord, 1, 1);
- MigrateCreateFold(acct, id, "Stub Messages 2", 1, ord, 1, 1);
- }
-
- //-----------------------------------------------------------------------------
- // MigLibMigrateFoldsAndMsgs
- //
- // This function takes three arguments:
- //
- // pMigInfo pmi: The MigInfo structure that is currently being
- // migrated. The data fields in this structure can
- // be used for reference purposes.
- //
- //
- // The next two arguments are function to control folders and messages.
- // Their prototypes are:
- //
- // int MigrateCreateAddressBook(char *name, int sortord, int sorttype);
- //
- // name: the name of the address book
- // sortord: the sort order of the address book
- // (0==ascending;1==descending)
- // sorttype: the sort type of the address book
- // (0==alias;1==email address;2==real name;3==phone #)
- //
- // int MigrateAddAddress(int id, pMigAddr data);
- //
- // In this function, you would create address books. To do this, one would
- // call MigrateCreateAddressBook. This function returns an address book id.
- // Then, you can call MigrateAddAddress using an addres book id. When creating
- // the MigAddr structure used by MigrateAddAddress, you *must* call MigLibAllocAddr.
- // That function sets up certain defaults. You set the values which are available,
- // and pass that struct into MigrateAddAddress. The members of MigAddr are
- // defined in migobj.h
- //
- // This function does not return a value.
- //
- //-----------------------------------------------------------------------------
-
- void MigLibMigrateAddrData(pMigInfo pmi, PFNADDRBOOK MigrateCreateAddressBook, PFNADDTOBOOK MigrateAddAddress){
- pMigAddr addr;
- int id;
-
- id=MigrateCreateAddressBook("Test", 1, 1);
-
- addr=MigLibAllocAddr();
- addr->Alias="Test";
- addr->Name="Test";
- addr->EMail="Test";
- MigrateAddAddress(id, addr);
- }
-
- //-----------------------------------------------------------------------------
- // MigManualInfo
- //
- // This function takes three arguments:
- //
- // pMigInfo pmi: The MigInfo structure that is currently being
- // migrated. The data fields in this structure can
- // be used for reference purposes.
- //
- //
- // This function is called when the user uses the "Add Mailer" button.
- // You can use it to prompt the user for information when they want to
- // manually migrate a mailer. A mailer would be manually migrated if
- // there is no way to determine its presence or location.
- //
- // Return TRUE if the information was gathered properly or FALSE if it
- // was not.
- //
- //-----------------------------------------------------------------------------
-
- BOOL MigManualInfo(pMigInfo pmi){
- return(TRUE);
- }
-
-
-
-
-
-
-
-
-
-